About Using jQuery in Working Preview

Description

In some situations, jQuery is not loaded when testing a UX Component in Working Preview. When this happens, the UX component may not behave as expected. To work around this limitation, using Chrome in Working Preview, using Live Preview, or publishing to local host can be used in lieu of Working Preview to test a component. Alternatively, the internal jQuery library can be manually loaded using an Ajax callback.

Discussion

When you do a Working Preview of a UX component and all of the following conditions are met:

  • The UX is set to pre-render
  • Working Preview is set to use Internet Explorer, not Chrome
  • jQuery is set to load using the Internal version (set in the Project Properties dialog)

then jQuery will not be loaded.

jQuery and Working Preview

If you need to have jQuery loaded while you are in Working Preview then you can either switch to Chrome for Working Preview, or change where jQuery is loaded from.

If you cannot switch to Chrome for Working Preview, and you cannot change the location from which jQuery is loaded, then you will have to make an Ajax callback to load jQuery. For example, you could use the following Xbasic function to handle the Ajax callback that loads the internal version of jQuery.

function loadJQuery as c (e as p)
    loadJQuery  = __hidden__javascript__a5_jquery_core() + crlf() + __hidden__javascript__a5_jquery_ui()
end function

Google Chrome is used exclusively to render Live and Working Preview. The Internet Explorer option was removed in newer versions of Alpha Anywhere due to the fact that IE is no longer maintained or updated to keep current with modern HTML, CSS, and JavaScript standards.